import request from '@/utils/request'

// 查询学员列表
export function listStudents(query) {
  return request({
    url: '/training/students/list',
    method: 'get',
    params: query
  })
}

// 查询学员详细
export function getStudents(studentId) {
  return request({
    url: '/training/students/' + studentId,
    method: 'get'
  })
}

// 新增学员
export function addStudents(data) {
  return request({
    url: '/training/students',
    method: 'post',
    data: data
  })
}

// 新增学员-同步用户 lqx
export function addStudentsWithUser(data) {
  return request({
    url: '/training/students/addWithUser',
    method: 'post',
    data: data
  })
}

// 修改学员
export function updateStudents(data) {
  return request({
    url: '/training/students',
    method: 'put',
    data: data
  })
}

// 修改学员-同步用户 lqx
export function updateStudentsWithUser(data) {
  return request({
    url: '/training/students/editWithUser',
    method: 'put',
    data: data
  })
}

// 删除学员
export function delStudents(studentId) {
  return request({
    url: '/training/students/' + studentId,
    method: 'delete'
  })
}

// 删除学员
export function userList(query) {
  return request({
    url: '/training/students/userList' ,
    method: 'get',
    params: query
  })
}

// 删除学员-同步用户 lqx
export function delStudentsWithUser(studentId) {
  return request({
    url: '/training/students/removeWithUser/' + studentId,
    method: 'delete'
  })
}

//查询学员成绩
export function getStudentGradeInfo(studentId) {
  return request({
    url: '/training/students/getStudentGradeInfo/'+studentId,
    method: 'get'
  })
}


//查询学员证书
export function getStudentCertificateInfo(studentId) {
  return request({
    url: '/training/students/getStudentCertificateInfo/'+studentId,
    method: 'get'
  })
}
